package com.etc.delivery.service.admin.impl;

import com.etc.delivery.dao.admin.AdminUserDao;
import com.etc.delivery.entity.User;
import com.etc.delivery.service.admin.IAdminUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminUserServiceImpl implements IAdminUserService {

    @Resource
    private AdminUserDao userDao;

    @Override
    public PageInfo<User> queryUser(String name, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<User> list = userDao.queryUser(name);
        PageInfo pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public boolean deleteUser(Integer id) {
        return userDao.deleteUser(id);
    }


}
